﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero"
	mc:Ignorable="d"
	x:Class="VisualWip.WorkItemKeyPad"
	x:Name="UserControl"
	d:DesignWidth="640" d:DesignHeight="480">

	<UserControl.Resources>
		<Style x:Key="ButtonFocusVisual">
			<Setter Property="Control.Template">
				<Setter.Value>
					<ControlTemplate>
						<Rectangle Margin="2" SnapsToDevicePixels="true" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<LinearGradientBrush x:Key="ButtonNormalBackground" EndPoint="0,1" StartPoint="0,0">
			<GradientStop Color="#F3F3F3" Offset="0"/>
			<GradientStop Color="#EBEBEB" Offset="0.5"/>
			<GradientStop Color="#DDDDDD" Offset="0.5"/>
			<GradientStop Color="#CDCDCD" Offset="1"/>
		</LinearGradientBrush>
		<SolidColorBrush x:Key="ButtonNormalBorder" Color="#FF707070"/>
		<Style x:Key="NumberButtonStyle" TargetType="{x:Type Button}">
			<Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/>
			<Setter Property="Background" Value="{StaticResource ButtonNormalBackground}"/>
			<Setter Property="BorderBrush" Value="{StaticResource ButtonNormalBorder}"/>
			<Setter Property="BorderThickness" Value="1"/>
			<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
			<Setter Property="HorizontalContentAlignment" Value="Center"/>
			<Setter Property="VerticalContentAlignment" Value="Center"/>
			<Setter Property="Padding" Value="1"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type Button}">
						<Microsoft_Windows_Themes:ButtonChrome x:Name="Chrome" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" RenderMouseOver="{TemplateBinding IsMouseOver}" RenderPressed="{TemplateBinding IsPressed}" RenderDefaulted="{TemplateBinding IsDefaulted}" SnapsToDevicePixels="true">
							<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
						</Microsoft_Windows_Themes:ButtonChrome>
						<ControlTemplate.Triggers>
							<Trigger Property="IsKeyboardFocused" Value="true">
								<Setter Property="RenderDefaulted" TargetName="Chrome" Value="true"/>
							</Trigger>
							<Trigger Property="ToggleButton.IsChecked" Value="true">
								<Setter Property="RenderPressed" TargetName="Chrome" Value="true"/>
							</Trigger>
							<Trigger Property="IsEnabled" Value="false">
								<Setter Property="Foreground" Value="#ADADAD"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
	</UserControl.Resources>

	<Grid x:Name="LayoutRoot">
		<TextBox HorizontalAlignment="Left" Height="50" Margin="40,42,0,0" TextWrapping="Wrap" Text="{Binding WorkItemId}" VerticalAlignment="Top" Width="212" FontSize="24" FontWeight="Bold" TextAlignment="Right"/>
		<Button Content="7" HorizontalAlignment="Left" Height="50" Margin="40,119,0,0" VerticalAlignment="Top" Width="50" Style="{DynamicResource NumberButtonStyle}"/>
		<Button Content="8" HorizontalAlignment="Left" Height="50" Margin="121,119,0,0" VerticalAlignment="Top" Width="50"/>
		<Button Content="9" HorizontalAlignment="Left" Height="50" Margin="202,119,0,0" VerticalAlignment="Top" Width="50"/>
		<Button Content="4" HorizontalAlignment="Left" Margin="40,200,0,230" Width="50"/>
		<Button Content="5" HorizontalAlignment="Left" Margin="121,200,0,230" Width="50"/>
		<Button Content="6" HorizontalAlignment="Left" Margin="202,200,0,230" Width="50"/>
		<Button Content="1" HorizontalAlignment="Left" Height="50" Margin="40,0,0,150" VerticalAlignment="Bottom" Width="50"/>
		<Button Content="2" HorizontalAlignment="Left" Height="50" Margin="121,0,0,150" VerticalAlignment="Bottom" Width="50"/>
		<Button Content="3" HorizontalAlignment="Left" Height="50" Margin="202,0,0,150" VerticalAlignment="Bottom" Width="50" Style="{DynamicResource NumberButtonStyle}"/>
		<Button Content="0" HorizontalAlignment="Left" Height="50" Margin="121,0,0,73" VerticalAlignment="Bottom" Width="50" Style="{DynamicResource NumberButtonStyle}" Command="{Binding }" />
		<Button Content="Open" Margin="284,119,306,150"/>
		<Button Content="Clear" Height="50" Margin="284,42,306,0" VerticalAlignment="Top"/>
	</Grid>
</UserControl>